<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.14.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>DM-CtrlH7-BF-DevProgram: C:/Users/ASUS/Desktop/dm-ctrlH7-balance-9025test/bsp/pwm/bsp_pwm.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="50x5.png"/></td>
  <td id="projectalign">
   <div id="projectname">DM-CtrlH7-BF-DevProgram<span id="projectnumber">&#160;beta 0.1</span>
   </div>
   <div id="projectbrief">C.ONE Studio Damiao Development Board Framework</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.14.0 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search',true);
  $(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(function(){initNavTree('bsp__pwm_8h.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">bsp_pwm.h File Reference</div></div>
</div><!--header-->
<div class="contents">
<div class="textblock"><code>#include &quot;<a class="el" href="tim_8h_source.html">tim.h</a>&quot;</code><br />
<code>#include &quot;stdint.h&quot;</code><br />
<code>#include &quot;<a class="el" href="stm32h7xx__hal__rcc_8h_source.html">stm32h7xx_hal_rcc.h</a>&quot;</code><br />
<code>#include &quot;<a class="el" href="stm32h723xx_8h_source.html">stm32h723xx.h</a>&quot;</code><br />
</div>
<p><a href="bsp__pwm_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-nested-classes" class="groupheader"><a id="nested-classes" name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:pwm_5Fins_5Ftemp" id="r_pwm_5Fins_5Ftemp"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpwm__ins__temp.html">pwm_ins_temp</a></td></tr>
<tr class="memitem:PWM_5FInit_5FConfig_5Fs" id="r_PWM_5FInit_5FConfig_5Fs"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_w_m___init___config__s.html">PWM_Init_Config_s</a></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-define-members" class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a98b3ade23d4246ff52b29c99d2e80643" id="r_a98b3ade23d4246ff52b29c99d2e80643"><td class="memItemLeft" align="right" valign="top"><a id="a98b3ade23d4246ff52b29c99d2e80643" name="a98b3ade23d4246ff52b29c99d2e80643"></a>
#define&#160;</td><td class="memItemRight" valign="bottom"><b>PWM_DEVICE_CNT</b>&#160;&#160;&#160;16</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-typedef-members" class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ad1770b62de4b3cead73c1dffd33aed94" id="r_ad1770b62de4b3cead73c1dffd33aed94"><td class="memItemLeft" align="right" valign="top"><a id="ad1770b62de4b3cead73c1dffd33aed94" name="ad1770b62de4b3cead73c1dffd33aed94"></a>
typedef struct <a class="el" href="structpwm__ins__temp.html">pwm_ins_temp</a>&#160;</td><td class="memItemRight" valign="bottom"><b>PWMInstance</b></td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 id="header-func-members" class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a2120d2df21cbc0f5ce613cc894656623" id="r_a2120d2df21cbc0f5ce613cc894656623"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2120d2df21cbc0f5ce613cc894656623">PWMRegister</a> (<a class="el" href="struct_p_w_m___init___config__s.html">PWM_Init_Config_s</a> *config)</td></tr>
<tr class="memdesc:a2120d2df21cbc0f5ce613cc894656623"><td class="mdescLeft">&#160;</td><td class="mdescRight">注册一个pwm实例  <br /></td></tr>
<tr class="memitem:acd81680ae1e7064b568493eb50d0c6d2" id="r_acd81680ae1e7064b568493eb50d0c6d2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#acd81680ae1e7064b568493eb50d0c6d2">PWMStart</a> (<a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *pwm)</td></tr>
<tr class="memdesc:acd81680ae1e7064b568493eb50d0c6d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动pwm  <br /></td></tr>
<tr class="memitem:a1b6f35949a04703824318426cf726fe3" id="r_a1b6f35949a04703824318426cf726fe3"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a1b6f35949a04703824318426cf726fe3">PWMSetDutyRatio</a> (<a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *pwm, float dutyratio)</td></tr>
<tr class="memdesc:a1b6f35949a04703824318426cf726fe3"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置pwm占空比  <br /></td></tr>
<tr class="memitem:a0424e2983ba296a8acfa3a79bbad04a0" id="r_a0424e2983ba296a8acfa3a79bbad04a0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a0424e2983ba296a8acfa3a79bbad04a0">PWMStop</a> (<a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *pwm)</td></tr>
<tr class="memdesc:a0424e2983ba296a8acfa3a79bbad04a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">停止pwm  <br /></td></tr>
<tr class="memitem:a873e5ee427c6c73ce3c444daf26ac769" id="r_a873e5ee427c6c73ce3c444daf26ac769"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a873e5ee427c6c73ce3c444daf26ac769">PWMSetPeriod</a> (<a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *pwm, float period)</td></tr>
<tr class="memdesc:a873e5ee427c6c73ce3c444daf26ac769"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置pwm周期  <br /></td></tr>
<tr class="memitem:a4ad1e4350071eb83a7696aa52c586abf" id="r_a4ad1e4350071eb83a7696aa52c586abf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4ad1e4350071eb83a7696aa52c586abf">PWMStartDMA</a> (<a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *pwm, uint32_t *pData, uint32_t Size)</td></tr>
<tr class="memdesc:a4ad1e4350071eb83a7696aa52c586abf"><td class="mdescLeft">&#160;</td><td class="mdescRight">启动pwm dma传输  <br /></td></tr>
</table>
<a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
<div class="textblock"><dl class="section author"><dt>Author</dt><dd>your name (<a href="#" onclick="location.href='mai'+'lto:'+'you'+'@d'+'oma'+'in'+'.co'+'m'; return false;">you@d<span class="obfuscator">.nosp@m.</span>omai<span class="obfuscator">.nosp@m.</span>n.com</a>) </dd></dl>
<dl class="section version"><dt>Version</dt><dd>0.1 </dd></dl>
<dl class="section date"><dt>Date</dt><dd>2023-02-14</dd></dl>
<dl class="section copyright"><dt>Copyright</dt><dd>Copyright (c) 2023 </dd></dl>
</div><a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Function Documentation</h2>
<a id="a2120d2df21cbc0f5ce613cc894656623" name="a2120d2df21cbc0f5ce613cc894656623"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2120d2df21cbc0f5ce613cc894656623">&#9670;&#160;</a></span>PWMRegister()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="structpwm__ins__temp.html">PWMInstance</a> * PWMRegister </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_p_w_m___init___config__s.html">PWM_Init_Config_s</a> *</td>          <td class="paramname"><span class="paramname"><em>config</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>注册一个pwm实例 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">config</td><td>初始化配置 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>PWMInstance* </dd></dl>

</div>
</div>
<a id="a1b6f35949a04703824318426cf726fe3" name="a1b6f35949a04703824318426cf726fe3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1b6f35949a04703824318426cf726fe3">&#9670;&#160;</a></span>PWMSetDutyRatio()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PWMSetDutyRatio </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *</td>          <td class="paramname"><span class="paramname"><em>pwm</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>dutyratio</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置pwm占空比 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pwm</td><td>pwm实例 </td></tr>
    <tr><td class="paramname">dutyratio</td><td>占空比 0~1 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a873e5ee427c6c73ce3c444daf26ac769" name="a873e5ee427c6c73ce3c444daf26ac769"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a873e5ee427c6c73ce3c444daf26ac769">&#9670;&#160;</a></span>PWMSetPeriod()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PWMSetPeriod </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *</td>          <td class="paramname"><span class="paramname"><em>pwm</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float</td>          <td class="paramname"><span class="paramname"><em>period</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置pwm周期 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pwm</td><td>pwm实例 </td></tr>
    <tr><td class="paramname">period</td><td>周期 单位 s </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="acd81680ae1e7064b568493eb50d0c6d2" name="acd81680ae1e7064b568493eb50d0c6d2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd81680ae1e7064b568493eb50d0c6d2">&#9670;&#160;</a></span>PWMStart()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PWMStart </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *</td>          <td class="paramname"><span class="paramname"><em>pwm</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>启动pwm </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pwm</td><td>pwm实例 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a4ad1e4350071eb83a7696aa52c586abf" name="a4ad1e4350071eb83a7696aa52c586abf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ad1e4350071eb83a7696aa52c586abf">&#9670;&#160;</a></span>PWMStartDMA()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PWMStartDMA </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *</td>          <td class="paramname"><span class="paramname"><em>pwm</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t *</td>          <td class="paramname"><span class="paramname"><em>pData</em></span>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t</td>          <td class="paramname"><span class="paramname"><em>Size</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>启动pwm dma传输 </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pwm</td><td>pwm实例 </td></tr>
    <tr><td class="paramname">pData</td><td>数据首地址指针,注意数据的位数必须和CubeMX配置的DMA传输位数(字长)一致 </td></tr>
    <tr><td class="paramname">Size</td><td>数据长度 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>如果使用此函数,则需要在CubeMX中配置DMA传输位数为对应位数 例如:使用16位数据,则需要配置DMA传输位数为16位(half word),配置错误会导致指针越界或数据错误 </dd></dl>

</div>
</div>
<a id="a0424e2983ba296a8acfa3a79bbad04a0" name="a0424e2983ba296a8acfa3a79bbad04a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0424e2983ba296a8acfa3a79bbad04a0">&#9670;&#160;</a></span>PWMStop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PWMStop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structpwm__ins__temp.html">PWMInstance</a> *</td>          <td class="paramname"><span class="paramname"><em>pwm</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>停止pwm </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">pwm</td><td>pwm实例 </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="page-nav" class="page-nav-panel">
<div id="page-nav-resize-handle"></div>
<div id="page-nav-tree">
<div id="page-nav-contents">
</div><!-- page-nav-contents -->
</div><!-- page-nav-tree -->
</div><!-- page-nav -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a href="dir_3c5459f7c179b79c90e2565474bb2856.html">bsp</a></li><li class="navelem"><a href="dir_a4c2dd4677da1a65d9fb26dc1165b535.html">pwm</a></li><li class="navelem"><a href="bsp__pwm_8h.html">bsp_pwm.h</a></li>
    <li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.14.0 </li>
  </ul>
</div>
</body>
</html>
